package top.whk0710.other.proxy;

import java.lang.reflect.Method;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

public class DemoMethodInterceptor implements MethodInterceptor{

	@Override
	public Object intercept(Object arg0, Method arg1, Object[] arg2,
			MethodProxy arg3) throws Throwable {
		System.out.println("before");
		Object obj = null;
		try{
			obj = arg3.invokeSuper(arg0, arg2);
		}catch(Exception e){
			throw e;
		}finally{
			System.out.println("after");
		}
		return obj;
	}

}
